package com.lm.ProxyPattern;

/**
 * 静态代理对象
 */
public class MyStaticProxy {

    private Subject subject;

    public MyStaticProxy(){
        subject = new RealSubject();
    }

    //代理方法
    public void request(){
        System.out.println("请求前处理");
        subject.sayHello();
        System.out.println("请求后处理");
    }

    public static void main(String[] args) {
        MyStaticProxy proxy = new MyStaticProxy();
        proxy.request();
    }
}
